function plotDeformedMesh(mesh,scale)
nn = mesh.countNodes();
nf = mesh.countFaces();
%% prepare adjacent matrix
adj = getAdjacentMatrix(mesh);
%% plot the mesh
figure
axis equal
for i=1:nn
    X1 = mesh.getNode(i-1).getPosition();
    for j=1:nn
        X2 = mesh.getNode(j-1).getPosition();
        if (adj(i,j)==1 || adj(j,i)==1) && i~=j
            line([X1(1) X2(1)],[X1(2) X2(2)]);
        end
    end
end

%% plot deformed mesh
hold on
for i=1:nn
    X1 = mesh.getNode(i-1).getPosition();
    dX1 = scale*mesh.getNode(i-1).getUHatLocal();
    for j=1:nn
        X2 = mesh.getNode(j-1).getPosition();
        dX2 = scale*mesh.getNode(j-1).getUHatLocal();
        if (adj(i,j)==1 || adj(j,i)==1) && i~=j
            line([X1(1)+dX1(1) X2(1)+dX2(1)],...
                [X1(2)+dX1(2) X2(2)+dX2(2)],...
                'color','r');
        end
    end
end

end
